﻿<%@ Page Title="Section Template" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="SectionTemplate.aspx.cs" Inherits="MPAlpa.Punkt" %>

<asp:Content ID="Content" ContentPlaceHolderID="MainContent" runat="server">
        <div class="Navigaton">
                <asp:ListView ID="SectionList" DataKeyNames="ArticleID" runat="server" DataSourceID="SectionListDataSource">
                    <LayoutTemplate>
                        <div ID="itemPlaceholder" runat="server">
                        </div>
                    </LayoutTemplate>  
                    <ItemTemplate> 
                        <asp:LinkButton ID="LinkButton1" Text='<%# Eval("Title") %>' CommandName="Select" runat="server" />
                    </ItemTemplate>
                </asp:ListView>
                <asp:SqlDataSource ID="SectionListDataSource" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    SelectCommand="SELECT [CategoryID], [ArticleID], [Title] FROM [md_Articles] WHERE (([CategoryID] = @CategoryID) AND ([Approved] = @Approved))" >
                    <SelectParameters>
                        <asp:Parameter DefaultValue="15" Name="CategoryID" Type="Int32" />
                        <asp:Parameter DefaultValue="false" Name="Approved" Type="Boolean" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
        <div id="Section">
            <asp:FormView ID="SectionData" DataSourceID="SectionDataSource" runat="server">
                <ItemTemplate>
                    <a href="#x" class="overlay" id="bigimage"></a>
                    <div class="popup">
                        <center><img title="" src="../Images/Sections/FullImages/<%# Eval("ImageFull")%>" alt="" /></center>
                        <a class="close" title="Закрыть" href="#close"></a>
                    </div>
                    <div id="inf">
                        <a href="#bigimage"><img id="Photo" src="../Images/Sections/PreviewImages/<%# Eval("ImagePreview")%>" alt="" onclick="javascript:openDialog();"/></a>
                        <div id="Titles">
                            <h1><asp:Label ID="SectionTitleLabel" Text='<%# Bind("Title") %>' runat="server" /></h1>
                            <h2><asp:Label ID="SectionSubtitleLabel" runat="server" Text='<%# Bind("Subtitle") %>' /></h2>
                        </div>
                    </div>
                    <div id="text">
                        <asp:Label ID="SectionContentLabel" runat="server" Text='<%# Bind("Body") %>' />
                    </div>
                </ItemTemplate>
            </asp:FormView>
            <asp:SqlDataSource ID="SectionDataSource" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                SelectCommand="SELECT [Title], [Subtitle], [Body], [ImagePreview], [ImageFull] FROM [md_Articles] WHERE ([ArticleID] = @ArticleID)"  >
                <SelectParameters>
                    <asp:ControlParameter ControlID="SectionList" DefaultValue="" Name="ArticleID" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>           
    </div>
</asp:Content>